Integrand size = 14, antiderivative size = 153 \[ \int \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\frac {1}{2} \left (2 a^2+b^2\right ) x-\frac {b^2 \sqrt {\pi } \cos (2 c) \operatorname {FresnelC}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )}{4 \sqrt {d}}+\frac {a b \sqrt {2 \pi } \cos (c) \operatorname {FresnelS}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )}{\sqrt {d}}+\frac {a b \sqrt {2 \pi } \operatorname {FresnelC}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right ) \sin (c)}{\sqrt {d}}+\frac {b^2 \sqrt {\pi } \operatorname {FresnelS}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right ) \sin (2 c)}{4 \sqrt {d}} \]
1/2*(2*a^2+b^2)*x-1/4*b^2*cos(2*c)*FresnelC(2*x*d^(1/2)/Pi^(1/2))*Pi^(1/2) /d^(1/2)+1/4*b^2*FresnelS(2*x*d^(1/2)/Pi^(1/2))*sin(2*c)*Pi^(1/2)/d^(1/2)+ a*b*cos(c)*FresnelS(x*d^(1/2)*2^(1/2)/Pi^(1/2))*2^(1/2)*Pi^(1/2)/d^(1/2)+a *b*FresnelC(x*d^(1/2)*2^(1/2)/Pi^(1/2))*sin(c)*2^(1/2)*Pi^(1/2)/d^(1/2)
Time = 0.22 (sec) , antiderivative size = 147, normalized size of antiderivative = 0.96 \[ \int \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\frac {4 a^2 \sqrt {d} x+2 b^2 \sqrt {d} x-b^2 \sqrt {\pi } \cos (2 c) \operatorname {FresnelC}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )+4 a b \sqrt {2 \pi } \cos (c) \operatorname {FresnelS}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )+4 a b \sqrt {2 \pi } \operatorname {FresnelC}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right ) \sin (c)+b^2 \sqrt {\pi } \operatorname {FresnelS}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right ) \sin (2 c)}{4 \sqrt {d}} \]
(4*a^2*Sqrt[d]*x + 2*b^2*Sqrt[d]*x - b^2*Sqrt[Pi]*Cos[2*c]*FresnelC[(2*Sqr t[d]*x)/Sqrt[Pi]] + 4*a*b*Sqrt[2*Pi]*Cos[c]*FresnelS[Sqrt[d]*Sqrt[2/Pi]*x] + 4*a*b*Sqrt[2*Pi]*FresnelC[Sqrt[d]*Sqrt[2/Pi]*x]*Sin[c] + b^2*Sqrt[Pi]*F resnelS[(2*Sqrt[d]*x)/Sqrt[Pi]]*Sin[2*c])/(4*Sqrt[d])
Time = 0.30 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3838, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx\) |
\(\Big \downarrow \) 3838 |
\(\displaystyle \int \left (a^2+2 a b \sin \left (c+d x^2\right )-\frac {1}{2} b^2 \cos \left (2 c+2 d x^2\right )+\frac {b^2}{2}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{2} x \left (2 a^2+b^2\right )+\frac {\sqrt {2 \pi } a b \sin (c) \operatorname {FresnelC}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )}{\sqrt {d}}+\frac {\sqrt {2 \pi } a b \cos (c) \operatorname {FresnelS}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )}{\sqrt {d}}-\frac {\sqrt {\pi } b^2 \cos (2 c) \operatorname {FresnelC}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )}{4 \sqrt {d}}+\frac {\sqrt {\pi } b^2 \sin (2 c) \operatorname {FresnelS}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )}{4 \sqrt {d}}\) |
((2*a^2 + b^2)*x)/2 - (b^2*Sqrt[Pi]*Cos[2*c]*FresnelC[(2*Sqrt[d]*x)/Sqrt[P i]])/(4*Sqrt[d]) + (a*b*Sqrt[2*Pi]*Cos[c]*FresnelS[Sqrt[d]*Sqrt[2/Pi]*x])/ Sqrt[d] + (a*b*Sqrt[2*Pi]*FresnelC[Sqrt[d]*Sqrt[2/Pi]*x]*Sin[c])/Sqrt[d] + (b^2*Sqrt[Pi]*FresnelS[(2*Sqrt[d]*x)/Sqrt[Pi]]*Sin[2*c])/(4*Sqrt[d])
3.1.20.3.1 Defintions of rubi rules used
Int[((a_.) + (b_.)*Sin[(c_.) + (d_.)*((e_.) + (f_.)*(x_))^(n_)])^(p_), x_Sy mbol] :> Int[ExpandTrigReduce[(a + b*Sin[c + d*(e + f*x)^n])^p, x], x] /; F reeQ[{a, b, c, d, e, f}, x] && IGtQ[p, 1] && IGtQ[n, 1]
Time = 0.18 (sec) , antiderivative size = 98, normalized size of antiderivative = 0.64
method | result | size |
parts | \(a^{2} x +b^{2} \left (\frac {x}{2}-\frac {\sqrt {\pi }\, \left (\cos \left (2 c \right ) \operatorname {C}\left (\frac {2 x \sqrt {d}}{\sqrt {\pi }}\right )-\sin \left (2 c \right ) \operatorname {S}\left (\frac {2 x \sqrt {d}}{\sqrt {\pi }}\right )\right )}{4 \sqrt {d}}\right )+\frac {a b \sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (c \right ) \operatorname {S}\left (\frac {x \sqrt {d}\, \sqrt {2}}{\sqrt {\pi }}\right )+\sin \left (c \right ) \operatorname {C}\left (\frac {x \sqrt {d}\, \sqrt {2}}{\sqrt {\pi }}\right )\right )}{\sqrt {d}}\) | \(98\) |
default | \(a^{2} x +\frac {b^{2} x}{2}-\frac {b^{2} \sqrt {\pi }\, \left (\cos \left (2 c \right ) \operatorname {C}\left (\frac {2 x \sqrt {d}}{\sqrt {\pi }}\right )-\sin \left (2 c \right ) \operatorname {S}\left (\frac {2 x \sqrt {d}}{\sqrt {\pi }}\right )\right )}{4 \sqrt {d}}+\frac {a b \sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (c \right ) \operatorname {S}\left (\frac {x \sqrt {d}\, \sqrt {2}}{\sqrt {\pi }}\right )+\sin \left (c \right ) \operatorname {C}\left (\frac {x \sqrt {d}\, \sqrt {2}}{\sqrt {\pi }}\right )\right )}{\sqrt {d}}\) | \(99\) |
risch | \(a^{2} x +\frac {i a b \,{\mathrm e}^{-i c} \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {i d}\, x \right )}{2 \sqrt {i d}}+\frac {b^{2} x}{2}-\frac {b^{2} {\mathrm e}^{-2 i c} \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\sqrt {2}\, \sqrt {i d}\, x \right )}{16 \sqrt {i d}}-\frac {b^{2} {\mathrm e}^{2 i c} \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {-2 i d}\, x \right )}{8 \sqrt {-2 i d}}-\frac {i a b \,{\mathrm e}^{i c} \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {-i d}\, x \right )}{2 \sqrt {-i d}}\) | \(131\) |
a^2*x+b^2*(1/2*x-1/4*Pi^(1/2)/d^(1/2)*(cos(2*c)*FresnelC(2*x*d^(1/2)/Pi^(1 /2))-sin(2*c)*FresnelS(2*x*d^(1/2)/Pi^(1/2))))+a*b*2^(1/2)*Pi^(1/2)/d^(1/2 )*(cos(c)*FresnelS(x*d^(1/2)*2^(1/2)/Pi^(1/2))+sin(c)*FresnelC(x*d^(1/2)*2 ^(1/2)/Pi^(1/2)))
Time = 0.28 (sec) , antiderivative size = 134, normalized size of antiderivative = 0.88 \[ \int \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\frac {4 \, \sqrt {2} \pi a b \sqrt {\frac {d}{\pi }} \cos \left (c\right ) \operatorname {S}\left (\sqrt {2} x \sqrt {\frac {d}{\pi }}\right ) + 4 \, \sqrt {2} \pi a b \sqrt {\frac {d}{\pi }} \operatorname {C}\left (\sqrt {2} x \sqrt {\frac {d}{\pi }}\right ) \sin \left (c\right ) - \pi b^{2} \sqrt {\frac {d}{\pi }} \cos \left (2 \, c\right ) \operatorname {C}\left (2 \, x \sqrt {\frac {d}{\pi }}\right ) + \pi b^{2} \sqrt {\frac {d}{\pi }} \operatorname {S}\left (2 \, x \sqrt {\frac {d}{\pi }}\right ) \sin \left (2 \, c\right ) + 2 \, {\left (2 \, a^{2} + b^{2}\right )} d x}{4 \, d} \]
1/4*(4*sqrt(2)*pi*a*b*sqrt(d/pi)*cos(c)*fresnel_sin(sqrt(2)*x*sqrt(d/pi)) + 4*sqrt(2)*pi*a*b*sqrt(d/pi)*fresnel_cos(sqrt(2)*x*sqrt(d/pi))*sin(c) - p i*b^2*sqrt(d/pi)*cos(2*c)*fresnel_cos(2*x*sqrt(d/pi)) + pi*b^2*sqrt(d/pi)* fresnel_sin(2*x*sqrt(d/pi))*sin(2*c) + 2*(2*a^2 + b^2)*d*x)/d
\[ \int \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\int \left (a + b \sin {\left (c + d x^{2} \right )}\right )^{2}\, dx \]
Result contains complex when optimal does not.
Time = 0.34 (sec) , antiderivative size = 129, normalized size of antiderivative = 0.84 \[ \int \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=-\frac {\sqrt {2} \sqrt {\pi } {\left ({\left (-\left (i + 1\right ) \, \cos \left (c\right ) + \left (i - 1\right ) \, \sin \left (c\right )\right )} \operatorname {erf}\left (\sqrt {i \, d} x\right ) + {\left (\left (i - 1\right ) \, \cos \left (c\right ) - \left (i + 1\right ) \, \sin \left (c\right )\right )} \operatorname {erf}\left (\sqrt {-i \, d} x\right )\right )} a b}{4 \, \sqrt {d}} + a^{2} x + \frac {{\left (4^{\frac {1}{4}} \sqrt {2} \sqrt {\pi } {\left ({\left (\left (i - 1\right ) \, \cos \left (2 \, c\right ) + \left (i + 1\right ) \, \sin \left (2 \, c\right )\right )} \operatorname {erf}\left (\sqrt {2 i \, d} x\right ) + {\left (-\left (i + 1\right ) \, \cos \left (2 \, c\right ) - \left (i - 1\right ) \, \sin \left (2 \, c\right )\right )} \operatorname {erf}\left (\sqrt {-2 i \, d} x\right )\right )} d^{\frac {3}{2}} + 16 \, d^{2} x\right )} b^{2}}{32 \, d^{2}} \]
-1/4*sqrt(2)*sqrt(pi)*((-(I + 1)*cos(c) + (I - 1)*sin(c))*erf(sqrt(I*d)*x) + ((I - 1)*cos(c) - (I + 1)*sin(c))*erf(sqrt(-I*d)*x))*a*b/sqrt(d) + a^2* x + 1/32*(4^(1/4)*sqrt(2)*sqrt(pi)*(((I - 1)*cos(2*c) + (I + 1)*sin(2*c))* erf(sqrt(2*I*d)*x) + (-(I + 1)*cos(2*c) - (I - 1)*sin(2*c))*erf(sqrt(-2*I* d)*x))*d^(3/2) + 16*d^2*x)*b^2/d^2
Result contains complex when optimal does not.
Time = 0.29 (sec) , antiderivative size = 195, normalized size of antiderivative = 1.27 \[ \int \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\frac {\sqrt {2} \sqrt {\pi } a b \operatorname {erf}\left (-\frac {1}{2} i \, \sqrt {2} x {\left (\frac {i \, d}{{\left | d \right |}} + 1\right )} \sqrt {{\left | d \right |}}\right ) e^{\left (i \, c\right )}}{2 \, {\left (\frac {i \, d}{{\left | d \right |}} + 1\right )} \sqrt {{\left | d \right |}}} + \frac {\sqrt {2} \sqrt {\pi } a b \operatorname {erf}\left (\frac {1}{2} i \, \sqrt {2} x {\left (-\frac {i \, d}{{\left | d \right |}} + 1\right )} \sqrt {{\left | d \right |}}\right ) e^{\left (-i \, c\right )}}{2 \, {\left (-\frac {i \, d}{{\left | d \right |}} + 1\right )} \sqrt {{\left | d \right |}}} - \frac {i \, \sqrt {\pi } b^{2} \operatorname {erf}\left (-i \, \sqrt {d} x {\left (\frac {i \, d}{{\left | d \right |}} + 1\right )}\right ) e^{\left (2 i \, c\right )}}{8 \, \sqrt {d} {\left (\frac {i \, d}{{\left | d \right |}} + 1\right )}} + \frac {i \, \sqrt {\pi } b^{2} \operatorname {erf}\left (i \, \sqrt {d} x {\left (-\frac {i \, d}{{\left | d \right |}} + 1\right )}\right ) e^{\left (-2 i \, c\right )}}{8 \, \sqrt {d} {\left (-\frac {i \, d}{{\left | d \right |}} + 1\right )}} + \frac {1}{2} \, {\left (2 \, a^{2} + b^{2}\right )} x \]
1/2*sqrt(2)*sqrt(pi)*a*b*erf(-1/2*I*sqrt(2)*x*(I*d/abs(d) + 1)*sqrt(abs(d) ))*e^(I*c)/((I*d/abs(d) + 1)*sqrt(abs(d))) + 1/2*sqrt(2)*sqrt(pi)*a*b*erf( 1/2*I*sqrt(2)*x*(-I*d/abs(d) + 1)*sqrt(abs(d)))*e^(-I*c)/((-I*d/abs(d) + 1 )*sqrt(abs(d))) - 1/8*I*sqrt(pi)*b^2*erf(-I*sqrt(d)*x*(I*d/abs(d) + 1))*e^ (2*I*c)/(sqrt(d)*(I*d/abs(d) + 1)) + 1/8*I*sqrt(pi)*b^2*erf(I*sqrt(d)*x*(- I*d/abs(d) + 1))*e^(-2*I*c)/(sqrt(d)*(-I*d/abs(d) + 1)) + 1/2*(2*a^2 + b^2 )*x
Timed out. \[ \int \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\int {\left (a+b\,\sin \left (d\,x^2+c\right )\right )}^2 \,d x \]